//
//  ALPTopListTableViewCell.m
//  AlpFM
//
//  Created by KING on 16/3/1.
//  Copyright © 2016年 Alp. All rights reserved.
//

#import "ALPTopListTableViewCell.h"

@interface ALPTopListTableViewCell()
@property (nonatomic, strong) UIImageView *headerView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *subTitleLabel;
@property (nonatomic, strong) UILabel *firstTopLabel;



@end

@implementation ALPTopListTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self p_create];
    }
    return self;
}



- (void)p_create{
    
    //图
    self.headerView = [[UIImageView alloc] initWithFrame:CGRectMake(0.04*SCREEN_WIDTH, 0.027*SCREEN_WIDTH, 0.16*SCREEN_WIDTH, 0.16*SCREEN_WIDTH)];
//    self.headerView.backgroundColor = CLEAR;
    //    self.headerView.image = [UIImage imageNamed:@"girledg"];
    [self.contentView addSubview:self.headerView];
    
    
    //标题
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(85, 0.027*SCREEN_WIDTH, 200, 0.053*SCREEN_WIDTH)];
    [self.contentView addSubview:self.titleLabel];
    self.titleLabel.font = [UIFont systemFontOfSize:0.039*SCREEN_WIDTH];
    self.titleLabel.text = @"你不知道的西游记";
//    self.titleLabel.backgroundColor = CLEAR;
    
    //二标题
    self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(85, 30, 200, 0.053*SCREEN_WIDTH)];
    [self.contentView addSubview:self.subTitleLabel];
    self.subTitleLabel.text = @"唐生骑着白马";
    self.subTitleLabel.font = [UIFont systemFontOfSize:0.035*SCREEN_WIDTH];
//    self.subTitleLabel.backgroundColor = CLEAR;
    
    //三标题
    self.firstTopLabel = [[UILabel alloc] initWithFrame:CGRectMake(85, 50, 250, 0.053*SCREEN_WIDTH)];
    [self.contentView addSubview:self.firstTopLabel];
    self.firstTopLabel.text = @"二师兄,大师兄说得对";
    self.firstTopLabel.font = [UIFont systemFontOfSize:0.035*SCREEN_WIDTH];
//    self.firstTopLabel.backgroundColor = CLEAR;
    
    //下面小条
    UIImageView *botView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0.267*SCREEN_WIDTH-2, SCREEN_WIDTH, 2)];
    [self.contentView addSubview:botView];
    botView.image = [UIImage imageNamed:@"bot"];
    
    
}


- (void)setModel:(ALPTopModel *)model{
    _model = model;
    NSURL *url = [NSURL URLWithString:_model.coverPath];
    [self.headerView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"girledg"]];
    
    self.titleLabel.text = _model.title;
    self.subTitleLabel.text = _model.subtitle;
    self.firstTopLabel.text = [NSString stringWithFormat:@"1.%@", _model.firstTitle];
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
